using System;
using Castle.ActiveRecord;
using CosyTrade.Data;

namespace CosyTrade.Distribution
{
    [AddPropertyChangedNotifyInterface, PropertyChangedNotify]
    [ActiveRecord("tabOrderDiscount"), Serializable]
    public class OrderDiscount : BusinessObject
    {
        private readonly Guid primaryKey = Guid.NewGuid();
        private int index;
        private double percent;
        private double total;
        private string memo;

        [PrimaryKey(PrimaryKeyType.Assigned, "ROWGUID", Access = PropertyAccess.NosetterCamelcase)]
        public override Guid PrimaryKey
        {
            get { return primaryKey; }
        }

        [Property("col_Index")]
        public int Index
        {
            get { return index; }
            set { index = value; }
        }

        [Property("col_Percent")]
        public double Percent
        {
            get { return percent; }
            set { percent = value; }
        }

        [Property]
        public double Total
        {
            get { return total; }
            set { total = value; }
        }

        [Property]
        public string Memo
        {
            get { return memo; }
            set { memo = value; }
        }
    }
}